TRUE,GA_IMMEDIATE,TRUE,0]))=NIL THEN RETURN ER_GADGET
IF (g:=CreateGadgetA(BUTTON_KIND,g,[scr.wborleft+87,offy+31,80,
11,' Fast ',tattr,1,PLACETEXT_IN,visual,'FAST']:newgadget,
[GTSC_TOP,2,GTSC_VISIBLE,3,
GTSC_TOTAL,10,GTSC_ARROWS,22,
PGA_FREEDOM,LORIENT_HORIZ,GA_RELVERIFY,
GTLV_SELECTED,
TRUE,GA_IMMEDIATE,TRUE,0]))=NIL THEN RETURN ER_GADGET
/*IF (wnd:=OpenW(scr.width-182,scr.height-46-offy,182,offy+46,$30C OR SCROOLERIDCMP,8+2+$1000,'MemFree v0.0e',scr,2,glist))=NIL THEN RETURN ER_WINDOW*/
IF (wnd:=OpenW(scr.width-182,scr.height-46-offy,182,offy+46,$40032C+BUTTONIDCMP,$100A,'MemFree v0.0e',scr,2,glist))=NIL THEN RETURN ER_WINDOW
wnd.screentitle:='MemFree v0.0e (c) 1993 NasGûl'
wndmp:=wnd.userport
rast:=wnd.rport
SetTopaz(8)
IF SetMenuStrip(wnd,menu)=FALSE THEN RETURN ER_MENUS
Gt_RefreshWindow(wnd,NIL)
display(gad)
ENDPROC
PROC closeinterface()
IF wnd THEN ClearMenuStrip(wnd)
IF menu THEN FreeMenus(menu)
IF visual THEN FreeVisualInfo(visual)
IF wnd THEN CloseWindow(wnd)
IF glist THEN FreeGadgets(glist)
IF scr THEN UnlockPubScreen(NIL,scr)
IF gadtoolsbase THEN CloseLibrary(gadtoolsbase)
IF intuitionbase THEN CloseLibrary(intuitionbase)
IF reqtoolsbase THEN CloseLibrary(reqtoolsbase)
IF rdargs THEN FreeArgs(rdargs)
IF iconbase THEN CloseLibrary(iconbase)
IF struc_diskobj THEN FreeDiskObject(struc_diskobj)
RTGS_TEXTFMT, 'Choix d\aun nouveau Public screen.',
TAG_DONE]:tagitem)
IF retour=1
ch_pubsc:=TRUE
StrCopy(pubscreen,str,ALL)
ENDIF
RtFreeRequest(req)
ENDIF
CASE $F840 /* QUITTER */
type:=IDCMP_CLOSEWINDOW
/******************************/
CASE $F801 /* MEM FAST */
def_gad:='FAST'
change_aff:=FALSE
CASE $F821 /* MEM CHIP */
def_gad:='CHIP'
change_aff:=FALSE
CASE $F841 /* FASTCHIP */
change_aff:=TRUE
CASE $F861 /* Virus D */
IF check_exec() THEN virus_action:=RtEZRequestA('Virus Détected.','ColdReboot|Gasp !!',0,0,[RT_PUBSCRNAME,pubscreen,RTEZ_REQTITLE,'MemFree v0.0e',TAG_DONE]:tagitem)
IF virus_action=1 THEN ColdReboot()
/******************************/
CASE $F802 /* Always Front */
IF front=TRUE
front:=FALSE
ELSE
front:=TRUE
ENDIF
DEFAULT; NOP
ENDSELECT
ELSEIF (type=IDCMP_GADGETDOWN) OR (type=IDCMP_GADGETUP)
g:=mes.iaddress
infos:=g.gadgetid
gad:=g.userdata
def_gad:=gad
display(gad)
change_aff:=FALSE
ELSEIF type=IDCMP_REFRESHWINDOW
Gt_BeginRefresh(wnd)
Gt_EndRefresh(wnd,TRUE)
type:=0
ELSEIF type<>IDCMP_CLOSEWINDOW
type:=0
ENDIF
Gt_ReplyIMsg(mes)
IF ch_pubsc=TRUE
ch_pubsc:=FALSE
zipped:=FALSE
close_win()
checkerror(openinterface())
ENDIF
ELSE
IF appmsg:=GetMsg(myport)
rexx_args:=appmsg.args
StrCopy(com_rexx,rexx_args[0],ALL)
IF StrCmp(com_rexx,'QUIT',ALL)
type:=IDCMP_CLOSEWINDOW
ELSEIF StrCmp(com_rexx,'FRONT',ALL)
WindowToFront(wnd)
ELSEIF StrCmp(com_rexx,'BACK',ALL)
WindowToBack(wnd)
ELSEIF StrCmp(com_rexx,'CHIP',ALL)
change_aff:=FALSE
def_gad:='CHIP'
display(def_gad)
ELSEIF StrCmp(com_rexx,'FASTCHIP',ALL)
change_aff:=TRUE
change_id:=0
ELSEIF StrCmp(com_rexx,'FAST',ALL)
change_aff:=FALSE
def_gad:='FAST'
display(def_gad)
ELSEIF StrCmp(com_rexx,'NOFRONT',ALL)
item_adr:=ItemAddress(menu,$F802)
front:=FALSE
item_adr.flags:=$605F
ELSEIF StrCmp(com_rexx,'YESFRONT',ALL)
item_adr:=ItemAddress(menu,$F802)
front:=TRUE
item_adr.flags:=$615F
ELSEIF StrCmp(com_rexx,'CHANGEPS',8)
IF StrLen(com_rexx)=8
StrCopy(pubscreen,'Workbench',ALL)
ELSE
MidStr(pubscreen,com_rexx,9,ALL)
ENDIF
zipped:=FALSE
close_win()
checkerror(openinterface())
ELSEIF StrCmp(com_rexx,'NEWDELAY',8)
MidStr(delay,com_rexx,9,ALL)
delay:=Val(delay,NIL)
IF delay<10 THEN delay:=10
ELSEIF StrCmp(com_rexx,'ZIP',ALL)
IF zipped=FALSE
SizeWindow(wnd,0,-46)
MoveWindow(wnd,0,46)
zip_piv:=TRUE
ELSEIF zipped=TRUE
MoveWindow(wnd,0,-46)
SizeWindow(wnd,0,46)
zip_piv:=FALSE
ENDIF
zipped:=zip_piv
ELSEIF StrCmp(com_rexx,'VD',2)
IF check_exec() THEN RtEZRequestA('Virus Détected.','ColdReboot|Gasp !!',0,0,[RT_PUBSCRNAME,pubscreen,RTEZ_REQTITLE,'MemFree v0.0e',TAG_DONE]:tagitem)
IF virus_action=1 THEN ColdReboot()
ENDIF
ReplyMsg(appmsg)
ENDIF
WHILE appmsg:=GetMsg(myport) DO ReplyMsg(appmsg)
IF (change_aff=TRUE) AND (change_id=0)
def_gad:='FAST'
change_id:=-1
ELSEIF change_aff=TRUE
def_gad:='CHIP'
change_id:=0
ENDIF
IF front=TRUE
Forbid()
Gt_BeginRefresh(wnd)
WindowToFront(wnd)
Gt_EndRefresh(wnd,TRUE)
Permit()
ENDIF
display(def_gad)
/*Delay(delay)*/
Wait(Shl(1,wndmp.sigbit))
ENDIF
UNTIL type
ENDPROC
PROC display(gad)
DEF chip,fast,largest_chip,largest_fast
DEF total_chip,total_fast
chip:=AvailMem($2)
fast:=AvailMem($4)
largest_chip:=AvailMem($20002)
largest_fast:=AvailMem($20004)
total_chip:=AvailMem($80002)
total_fast:=AvailMem($80004)
IF StrCmp(gad,'CHIP',ALL)
TextF(10,10+offy,' Chip :\d[9]',chip)
TextF(10,10+offy+8,' L Chip:\d[9]',largest_chip)
TextF(10,10+offy+16,' T Chip:\d[9]',total_chip)
ELSEIF StrCmp(gad,'FAST',ALL)
TextF(10,10+offy,' Fast :\d[9]',fast)
TextF(10,10+offy+8,' L Fast:\d[9]',largest_fast)
TextF(10,10+offy+16,' T Fast:\d[9]',total_fast)
ENDIF
ENDPROC
/*******************************/
/* Routines par EA van breemen */
/*******************************/
/* A small virus detector */
/* By EA van Breemen */
/*******************************/
/* Check procedure of execbase */
PROC check_exec()
DEF test
RtEZRequestA(' By EA van Breemen\n ~~~~~~~~~~~~~~~~~\nColdCapture :\z\h[8]\nCoolCapture :\z\h[8]\nKickMemPtr :\z\h[8]\nKickTagPtr :\z\h[8]',